<!DOCTYPE html>
<html>
<head>
    <title>登录</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="title">登录页</div>
    <div class="content">
        <div class="write-area">
            <form action="/login" onsubmit="return login()" id="loginForm" method="post">
            <div><input name="userId" id="userId" type="text" placeholder="input your userId"></div>
            <div>
                <input name="psw" id="psw" type="text" placeholder="input your psw">
            </div>
            <div>
                <button class="btn btn-default send">登录</button>
            </div>
            </form>
        </div>
    </div>
</div>

<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script>
    function login() {
        var userId = $('#userId').val();
        var psw = $('#psw').val();
        if (!userId) {
            alert('请输入用户账号!');
            return false;
        }
        if (!psw) {
            alert('请输入用户密码!');
            return false;
        }
        return true;
    }
</script>
</body>
</html>